package com.prj.ufdm.cloud.svr.gateway.bpo;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.server.ServerWebExchange;

import com.prj.ufdm.cloud.base.dto.RetData;
import com.prj.ufdm.cloud.svr.gateway.model.SysUser;

import reactor.core.publisher.Mono;

/**  
 * 权限认证BPO
 * @author 胡义振  
 * @date 2019年9月23日  
*/
public interface AuthBPO {
	
	public RetData<SysUser> validateAuthURI(String requestURI,SysUser sysUser) throws Exception;
	
	public RetData<SysUser> validateToken(ServerHttpRequest request)  throws Exception;
	
	public boolean checkAllowURI(String requestURI) throws Exception;
	
	public boolean checkAuthURI(String requestURI) throws Exception;
	
	public void setMetadadaSource(String requestURI) throws Exception;
	
	public Mono<Void> exchangeHandle(ServerWebExchange exchange, GatewayFilterChain chain, SysUser sysUser) throws Exception;
	
	public Mono<Void> exchangeErrHandle(ServerHttpResponse response,RetData<?> retData);
	
}
